* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(to bottom, #87CEEB, #4682B4);
    overflow: hidden;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#info-panel, #food-chain-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 500px;
}

#info-panel.hidden, #food-chain-panel.hidden {
    display: none;
}

#info-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

#info-description {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

#close-info, #close-food-chain {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#close-info:hover, #close-food-chain:hover {
    background: #2980b9;
}

#food-chain-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    font-size: 18px;
}

.chain-item {
    padding: 10px 15px;
    border-radius: 20px;
    margin: 0 5px;
    font-weight: bold;
}

#plant { background: #27ae60; color: white; }
#shrimp { background: #e74c3c; color: white; }
#fish { background: #f39c12; color: white; }
#egret { background: #9b59b6; color: white; }

.arrow {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 10px;
}

#controls {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#legend h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#legend ul {
    list-style: none;
}

#legend li {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
}

.producer { background: #27ae60; }
.consumer { background: #e74c3c; }
.decomposer { background: #8e44ad; }

#instructions {
    margin-top: 15px;
    color: #7f8c8d;
    font-style: italic;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.active {
    animation: pulse 1s ease-in-out infinite;
}